<?php
    function accm_Category_Management(){
        global $wpdb, $user_ID, $msg;
        
        /*$sql = "SELECT * FROM  wp_category_taxonomy_bk 
                WHERE type='pricerange'";
        $terms = $wpdb->get_results($sql);
        foreach($terms as $term){
            $slug = sanitize_title($term->title);
            $slug_exists = get_category_by_slug($slug);
            //check slug
            $i = 0;
            while($slug_exists->term_id > 0)  {
                $slug = sanitize_title($term->title).'-'. $i++;
                $slug_exists = get_category_by_slug($slug); 
            }
            $term = wp_insert_term($term->title, 'pricerange', array(
                                                'description'=> '',
                                                'slug' => $slug_exists,
                                                'parent'=> 0
                                            ) ); 
        }*/
    ?>
<div class="wrap" id="accm_Site_Manager" style="width: 1100px;">        
        <h2>Administration Panel - Categories</h2>
        <div id="tab-menu">
            <ul>
                <li class="right-tab <?php print ($_GET['tabmenu']=='category'? 'selected':'');?>"><a href="?page=<?php print $_GET['page'];?>&tabmenu=category">Categories</a></li>               
                <li class="<?php print ($_GET['tabmenu']=='categoryfield'? 'selected':'');?>"><strong>Category Field</strong></li>
                <li class="<?php print ($_GET['tabmenu']=='fields'? 'selected':'');?>"><a href="?page=<?php print $_GET['page'];?>&tabmenu=fields">Content Fields</a></li>
            </ul>
        </div> 
<div style="clear: both; height: 30px; width: 100%;"></div>    
     <?php
        switch($_GET['tabmenu']){
            case 'categoryfield';
                include('category/categoryfield.php');
            break;
            case 'subcategory';
                include('category/terms.php');
            break;
            case 'fields';
                include('category/fields.php');
            break;
            default;
                include('category/terms.php');
            break;
        }
    }       
?>